[MSBuild] Problem with setting properties 's values.
Posted
by Nam Gi VU
on Stack Overflow
See other posts from Stack Overflow
or by Nam Gi VU
Published on 2010-03-25T11:35:21Z
Indexed on
2010/03/25
22:03 UTC
Read the original article
Hit count: 192
Let's consider the below example. There, I have:
- target MAIN call target t then call target tt.
- target t call target ttt, target tt call target tttt.
- target t define property aa, target ttt modify aa.
- target tttt try to print property aa 's value.
- in short we have: MAIN -> {t -> {ttt->modify aa, define aa}, tt -> tttt -> print aa}
But in target tttt, we can't "see" aa's updated value (by ttt)! Please help me to make that value visible to target tttt. Thank you!
The whole script is as below:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="MAIN" >
<Target Name="MAIN" >
<CallTarget Targets="t" />
<CallTarget Targets="tt" />
</Target>
<Target Name="t">
<Message Text="t" />
<PropertyGroup>
<aa>1</aa>
</PropertyGroup>
<CallTarget Targets="ttt" />
</Target>
<Target Name="tt">
<Message Text="tt" />
<CallTarget Targets="tttt" />
</Target>
<Target Name="ttt">
<PropertyGroup>
<aa>122</aa>
</PropertyGroup>
<Message Text="ttt" />
</Target>
<Target Name="tttt">
<Message Text="tttt" />
<Message Text="tttt:$(aa)" />
</Target>
</Project>
© Stack Overflow or respective owner